<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Customization scripts</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../index.html" TARGET="_top"><img src="images/homeImg.png"></a></p>



<h1>Customization scripts <img src="images/customizationScriptIcon.jpg"></h1>

<p>Customization scripts are <a href="scripts.htm">embedded scripts</a> that can be used to customize a simulation scene to a great extent. They are attached to (or <em>associated with</em>) <a href="objects.htm">scene objects</a>, and they can be easily recognized from their dark script icon in the <a href="userInterface.htm#SceneHierarchy">scene hierarchy</a>:</p>

<p align=center><img src="images/customizationScripts0.jpg"></p>
<p class=imageLabel>[A customization script associated with object <em>Robot</em>]</p>

<p>Double-clicking the script icon allows opening the <a href="scriptEditor.htm">script editor</a>. You can change properties of a given script, or associate it with another object via the <a href="scriptProperties.htm">script dialog</a>. You can attach a new customization script to an object by selecting the object, then navigating to [menu bar --&gt; Add --&gt; Associated customization script]. </p>



<p>Following are customization script's main properties:</p>

<li>they are executed all the time (within a same scene): when simulation is running, as well as when simulation is not running.</li>
<li>they are attached to (or associated with) scene objects (i.e. they are <em>associated</em> scripts). Associated scripts form the basis of CoppeliaSim's distributed control architecture, and share the convenient property to be automatically duplicated if their associated object is duplicated. </li>


<p>Above properties allow customization scripts to share some of the best features of <a href="addOns.htm">add-ons</a> and <a href="childScripts.htm">child scripts</a>. Customization scripts allow the creation of customizable models for instance: imagine a <a href="models.htm">model</a> that was dropped into a scene, and that is able to configure or adapt itself, even when simulation is not running. This could be a robot where the user can adjust the various link lengths with a single slider repositioning.</p>




<p>Customization scripts should contain a collection of <a href="callbackFunctions.htm">callback functions</a>. Those should not be blocking. This means that every time they are called, they should perform some task and then return control. If control is not returned, then the whole application halts. Customization script functions are called by the system often, but also by the <a href="mainScript.htm">main script</a>, and follow a precise<a href="scriptExecution.htm"> execution order </a>in relation with other script types. </p>

<p>A customization script can <a href="threadedAndNonThreadedCode.htm">run threaded or non-threaded</a>, and should be segmented in several <a href="callbackFunctions.htm#systemCallbacks">system callback functions</a>. If possible, do not use customization scripts to run simulation code, which is anyway best handled via <a href="childScripts.htm">child scripts</a>.</p>
<br>
<br>
 </tr>
</table> 
</div>  
  
  
</body>

</html>
